import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ScreenUtils {
  /// 根据屏幕宽度适配尺寸
  static double setWidth(num w) {
    return ScreenUtil().setWidth(w);
  }

  /// 根据屏幕高度适配尺寸(一般根据宽度适配即可)
  static double setHeight(num h) {
    return ScreenUtil().setHeight(h);
  }

  /// 适配字体
  static double setSp(num sp) {
    return ScreenUtil().setSp(sp);
  }

  /// 根据宽度或高度中的较小者进行调整
  static double radius(num sp) {
    return ScreenUtil().radius(sp);
  }

  /// 设备的像素密度
  static double pixelRatio() {
    return ScreenUtil().pixelRatio;
  }

  /// 设备宽度
  static double screenWidth() {
    return ScreenUtil().screenWidth;
  }

  /// 设备高度
  static double screenHeight() {
    return ScreenUtil().screenHeight;
  }

  /// 底部安全区距离，适用于全面屏下面有按键的
  static double bottomBarHeight() {
    return ScreenUtil().bottomBarHeight;
  }

  /// 状态栏高度 刘海屏会更高
  static double statusBarHeight() {
    return ScreenUtil().statusBarHeight;
  }

  /// 系统字体缩放比例
  static double textScaleFactor() {
    return ScreenUtil().textScaleFactor;
  }

  /// 系统字体缩放比例
  static double scaleWidth() {
    return ScreenUtil().scaleWidth;
  }

  /// 系统字体缩放比例
  static double scaleHeight() {
    return ScreenUtil().scaleHeight;
  }

  /// 系统字体缩放比例
  static Orientation orientation() {
    return ScreenUtil().orientation;
  }
}
